<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        button{
            width: 100px;
            height: 50px;
            position: absolute;
            left: 0px;
            height: 50px;
        }
        .no{
            position: absolute;
            left: 100px;
            height: 50px;
        }
    </style>
</head>
<body>
    <div>你难道就是那个粤嵌最靓水的仔吗？</div>
    <button class="en">是</button>
    <button class="no">怎么可能</button>

    <script>
        var btn=document.querySelector("button")
        var b2=document.querySelector(".no")
        btn.onclick=function()
        {
            alert("对啊！")
        }
        var countTimes=0;
        b2.onmouseover=function()
        {
            if(countTimes>3)  //限制次数，大于三次之后就不执行后面的代码
            {
                return false;
            }
            this.style.left=parseInt(Math.random()*1000)+'px';  //必须加一个定位
            this.style.top=parseInt(Math.random()*600)+'px';
            countTimes++   //累积次数
        }
        b2.onclick=function()
        {
            alert('O(∩_∩)O哈哈~')
        }
    </script>
    
</body>
</html>